/*
*  Copyright 2019-2020 Zheng Jie
*
*  Licensed under the Apache License, Version 2.0 (the "License");
*  you may not use this file except in compliance with the License.
*  You may obtain a copy of the License at
*
*  http://www.apache.org/licenses/LICENSE-2.0
*
*  Unless required by applicable law or agreed to in writing, software
*  distributed under the License is distributed on an "AS IS" BASIS,
*  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*  See the License for the specific language governing permissions and
*  limitations under the License.
*/
package me.zhengjie.suli.check.domain;

import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.bean.copier.CopyOptions;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import me.zhengjie.base.BaseEntity;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import java.io.Serializable;

/**
* @website https://eladmin.vip
* @description /
* @author Allen Gao
* @date 2023-02-09
**/
@Entity
@Data
@Table(name="checks")
public class Checks extends BaseEntity implements Serializable {

    @Id
    @Column(name = "`id`")
    @ApiModelProperty(value = "ID")
    private String id;

    @Column(name = "`check_plan_code`")
    @ApiModelProperty(value = "盘点单号")
    private String checkPlanCode;

    @Column(name = "`warehouse_code`")
    @ApiModelProperty(value = "所属仓库")
    private String warehouseCode;

    @Column(name = "`status`")
    @ApiModelProperty(value = "状态")
    private Integer status;

    @Column(name = "`location_code`")
    @ApiModelProperty(value = "库位")
    private String locationCode;

    @Column(name = "`tray_code`")
    @ApiModelProperty(value = "载具")
    private String trayCode;

    @Column(name = "`material_code`")
    @ApiModelProperty(value = "物料")
    private String materialCode;

    @Column(name = "`lot_code`")
    @ApiModelProperty(value = "批次")
    private String lotCode;

    @Column(name = "`unit_code`")
    @ApiModelProperty(value = "单位")
    private String unitCode;


    public void copy(Checks source){
        BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
    }
}
